<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>Document</title>
        <link rel="stylesheet" href="elementUI/theme-default/index.css" />
    </head>
    <body>
        <div id="app">
            <template>
              <el-table
                :data="tableData"
                border
                style="width: 100%"
                :default-sort = "{prop: 'date', order: 'descending'}"
                >
                <el-table-column
                  prop="date"
                  label="日期"
                  sortable
                  width="180">
                </el-table-column>
                <el-table-column
                  prop="name"
                  label="姓名"
                  sortable
                  width="180">
                </el-table-column>
                <el-table-column
                  prop="address"
                  label="地址"
                  :formatter="formatter">
                </el-table-column>
              </el-table>
            </template>
        </div>
        <script src="js/vue.js"></script>
        <script src="elementUI/index.js"></script>
        <script>
            new Vue({
                el:"#app",
                data() {
                  return {
                    tableData: [{
                      date: '2016-05-02',
                      name: '王小虎',
                      address: '上海市普陀区金沙江路 1518 弄'
                    }, {
                      date: '2016-05-04',
                      name: '王小成',
                      address: '上海市普陀区金沙江路 1517 弄'
                    }, {
                      date: '2016-11-01',
                      name: '王小平',
                      address: '上海市普陀区金沙江路 1519 弄'
                    }, {
                      date: '2016-01-03',
                      name: '王小龙',
                      address: '上海市普陀区金沙江路 1516 弄'
                    }]
                  }
                },
                methods: {
                  formatter(row, column) {
                    return row.address+':上海';
                  }
                }
            });
        </script>
    </body>
</html>